package com.example.ourradio;

import com.squareup.otto.Bus;
import com.squareup.otto.ThreadEnforcer;

public enum BusManager {
    INSTANCE;

    private Bus mAnyBus;
    private Bus mMainBus;
    
    BusManager() {
    	mMainBus = new Bus();
    	mAnyBus = new Bus(ThreadEnforcer.ANY);
    }
    
    static public Bus getInstance() {
    	return INSTANCE.mMainBus;
    }
        
    static public Bus getInstance(ThreadEnforcer enforcer) {
    	if (enforcer == ThreadEnforcer.MAIN) {
    		return INSTANCE.mMainBus;
    	}
    	return INSTANCE.mAnyBus;
    }
}
